
#ifndef GOMOKU_REFEREE_DEFAULT_REFEREE_H__
# define GOMOKU_REFEREE_DEFAULT_REFEREE_H__

# include <gomoku/core/Gomoku.h>
# include <gomoku/core/IReferee.h>

namespace gomoku
{
    class DefaultReferee : public gomoku::IReferee
    {
    public:
        DefaultReferee();
        virtual ~DefaultReferee();

        // signal
        virtual void connectGui(IGui *gui);
        virtual void connectBlack(IPlayer *black);
        virtual void connectWhite(IPlayer *white);

        // STATE title screen : from gui keep next match to launch.
        virtual void nextMatch(Match const & match);

        // STATE game : loop game while have not victory.
        virtual void launch();
        // RULES
        virtual bool checkMove(Move const & move);
        // if move is correct update goban for referee, gui and players.
        virtual void updateGoban(Move const & move);
        // switch player and said to gui
        virtual void switchPlayer(Color color);

    private:
        IGui *_gui;
        IPlayer *_black;
        IPlayer *_white;

        Match _match;
    };
}


#endif  // GOMOKU_REFEREE_DEFAULT_REFEREE_H__
